package me.peng.domain.config;


import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.Column;
import java.io.Serializable;
import java.util.Date;

//pojo基类，完成2个任务，2个日期，实现序列化
@Data
@Accessors(chain=true)
public class UserBase implements Serializable{

    @TableField(fill = FieldFill.INSERT)
    @Column(name = "create_date")
    @CreationTimestamp
    @ApiModelProperty(value = "创建时间")
    private Date create_date;	//表示入库时需要赋值


    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Column(name = "renew_date")
    @UpdateTimestamp
    @ApiModelProperty(value = "更新时间")
    private Date renew_date;	//表示入库/更新时赋值.
}
